package org.example.repository;

import org.example.model.Student;
import org.example.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


public interface StudentRepository extends JpaRepository<Student, Long> {
    User findByName(String name);

    User findByNameAndAge(String name, Integer age);

    @Query("from Student u where u.name=:name")
    User findStudent(@Param("name") String name);
}
